package com.itheima.iostream;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class ByteStreamDemo6 {
    public static void main(String[] args) throws IOException {
        //文件拷贝的核心思想 边读边写

        FileInputStream fis = new FileInputStream("D:\\bbb.txt");
        FileOutputStream fos = new FileOutputStream("day28-code\\ccc");

        int b;
        while ((b=fis.read())!=-1){
            fos.write(b);
        }

        //规则：先建立的流最后释放
        fos.close();
        fis.close();
    }
}
